#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------
# -- This's login loading thread
# -- 
# ****************************
# Author: lmay.Zhou
# Blog: www.lmaye.com
# Date: 2017年8月31日11:44:09
# ----------------------------------------------------------

from PyQt5 import QtCore
from PyQt5.QtCore import pyqtSignal
from files.logs import Logger


class LoginLoadingThread(QtCore.QThread):
    # 通过类成员对象定义信号对象
    _signal = pyqtSignal(str);
    _log = Logger.log();

    def __init__(self, parent=None):
        super(LoginLoadingThread, self).__init__();

    def __del__(self):
        self.wait();

    def run(self):
        self._log.info("This's login loading thread ...");
        result = "";
        while (True):
            if result.__len__() < 3:
                result += ".";
            else:
                result = "";
            # 发出信号
            self._signal.emit(result);
            # 让程序休眠
            self.sleep(1);
